package com.huawei.hwid.vermanager;

import android.content.Context;
import com.huawei.hms.framework.network.restclient.RestClient;
import com.huawei.hwid.core.d.b.e;
import com.huawei.hwid.e.a;
import java.io.IOException;
import javax.net.ssl.HttpsURLConnection;

public final class VersionManager extends d {
    private static VersionManager g;
    private RestClient h;

    public static synchronized VersionManager b() {
        VersionManager versionManager;
        synchronized (VersionManager.class) {
            if (g == null) {
                g = new VersionManager();
            }
            versionManager = g;
        }
        return versionManager;
    }

    private VersionManager() {
        d();
    }

    private void d() {
        this.a = "/IUserInfoMng/updateHeadPic?Version=27120";
        this.d = "/CAS/mobile/standard/wapLogin.html";
        this.e = "/CAS/portal/userCenter/index.html";
        this.b = "/CAS/mobile/stLogin.html";
        this.c = "/CAS/mobile/standard/resetPwd/forgetbyid.html";
        this.f = "hms";
    }

    public String a() {
        return this.a;
    }

    public RestClient a(Context context, String str, int i, int i2) {
        e.b("ReleaseVersionManager", "getSafeHttpClient", true);
        try {
            this.h = a.a(context, str, 10000);
        } catch (IOException e) {
            e.d("ReleaseVersionManager", "IOException" + e.getClass().getSimpleName(), true);
        }
        return this.h;
    }

    public String a(Context context, int i) {
        return d(context, i) + this.b;
    }

    public String a(Context context) {
        return d(context, 0) + this.c;
    }

    public String b(Context context, int i) {
        return d(context, i) + this.d;
    }

    public String c(Context context, int i) {
        return d(context, i) + this.e;
    }

    public void a(HttpsURLConnection httpsURLConnection, Context context) {
        try {
            httpsURLConnection.setSSLSocketFactory(e.a().a(context));
        } catch (IOException e) {
            e.b("ReleaseVersionManager", "setSSLSocketFactory error, IOException", true);
        }
    }

    public String c() {
        return this.f;
    }
}
